<template>
	<el-scrollbar>
		<el-card shadow="hover" header="软件信息">
			<div class="logo">
				<img src="img/logo.png">
				<h2>欢迎使用稠云OA3.1</h2>
			</div>
			<div class="welcome">
				<div class="tips">
					<div class="tips-item">
						<div class="tips-item-icon">
							<el-icon>
								<el-icon-menu/>
							</el-icon>
						</div>
						<div class="tips-item-message">当前信息</div>
						<div style="text-align: left">
							<div class="tips-item-info">操作系统：{{ softRegInfo.OS_NAME }}</div>
							<div class="tips-item-info">系统版本：{{ softRegInfo.OS_VERSION }}</div>
							<div class="tips-item-info">应用服务器：{{ softRegInfo.serverInfo }}</div>
						</div>
					</div>
					<div class="tips-item">
						<div class="tips-item-icon">
							<el-icon>
								<el-icon-promotion/>
							</el-icon>
						</div>
						<div class="tips-item-message">当前信息</div>
						<div style="text-align: left">
							<div class="tips-item-info">JAVA版本:{{ softRegInfo.JAVA_VERSION }}</div>
							<div class="tips-item-info">JAVA目录:{{ softRegInfo.JAVA_HOME }}</div>
							<div class="tips-item-info">数据库类型:{{ softRegInfo.DB_TYPE }}</div>
							<div class="tips-item-info">数据库版本:{{ softRegInfo.DB_VERSION }}</div>
							<div class="tips-item-info">数据库安装路径:{{ softRegInfo.DB_PATH }}</div>
							<div class="tips-item-info">软件名称:{{ softRegInfo.SOFT_NAME }}</div>
							<div class="tips-item-info">软件版本:
								<span v-if="softRegInfo.theme=='0'">企业版</span>
								<span v-else-if="softRegInfo.theme=='1'">政务版</span>
								<span v-else-if="softRegInfo.theme=='2'">教育版</span>
								<span v-else>未知</span>
								{{ softRegInfo.P_VERSION }}【{{ softRegInfo.P_VERSION_OTHER }}】
							</div>
							<div class="tips-item-info">软件目录:{{ softRegInfo.APP_PATH }}</div>
							<div class="tips-item-info">软件版权:{{ softRegInfo.COPY_RIGHT }}</div>
							<div class="tips-item-info">研发公司:{{ softRegInfo.DEV_COM }}</div>
							<div class="tips-item-info">机器码:{{ softRegInfo.MACHINE_CODE }}</div>
							<div class="tips-item-info">当前组织:{{ softRegInfo.ORG_NAME }}</div>
						</div>
					</div>
					<div class="tips-item">
						<div class="tips-item-icon">
							<el-icon>
								<el-icon-monitor/>
							</el-icon>
						</div>
						<div class="tips-item-message">注册信息</div>
						<div style="text-align: left">
							<div class="tips-item-info">授权单位:{{ softRegInfo.REG_ORG_NAME }}</div>
							<div class="tips-item-info">授权组织数:{{ softRegInfo.ORG_COUNT }}</div>
							<div class="tips-item-info">授权人员数:{{ softRegInfo.USER_COUNT }}</div>
							<div class="tips-item-info">当前人员数:{{ softRegInfo.accountCount }}/人 （包含离职、注销、管理员，50人内免授权）</div>
							<div class="tips-item-info">授权日期:{{ softRegInfo.REG_DATE }}</div>
							<div class="tips-item-info">截止日期:{{ softRegInfo.SERVICE_END_TIME }}</div>
							<div class="tips-item-info">序列号:{{ softRegInfo.SN }}</div>
							<div class="tips-item-info">授权数据库类型:{{ softRegInfo.regDbType }}</div>
							<div class="tips-item-info">注册状态:
								<el-button type="success" round v-if="softRegInfo.IS_REGIST">已注册</el-button>
								<el-button type="danger" round v-if="!softRegInfo.IS_REGIST">未注册</el-button>
							</div>
							<div class="tips-item-info">授权组件:{{ softRegInfo.MODEL }}</div>
							<div class="tips-item-info" v-if="!softRegInfo.IS_REGIST">失败信息:
								<span v-for="(c,cIndex) in softRegInfo.REG_MSG_LIST" :key="cIndex" v-html="c">
						   </span>
							</div>
							<el-form v-if="!softRegInfo.IS_REGIST">
								<el-form-item label="注册文件">
									<sc-upload-file
										:limit="1"
										:apiObj="apiObj"
										v-model="regFile"
										:showFileList="false"
									>
										<el-button type="primary" icon="el-icon-upload">上传注册文件</el-button>
									</sc-upload-file>
								</el-form-item>
							</el-form>
						</div>
					</div>
				</div>
			</div>
			<div style="text-align: center">
				<el-button type="primary" @click="goLogin" >返回</el-button>
			</div>
		</el-card>
	</el-scrollbar>
</template>
<script>
export default {
	name: 'system',
	data() {
		return {
			regFile:[],
			softRegInfo: {},
			apiObj:this.$API.system.register.regSoft
		}
	},
	mounted() {
		this.getRegInfoApi();
	},
	methods: {
		async getRegInfoApi() {
			let res = await this.$API.system.register.getRegInfo.get();
			if (res.code == 200) {
				this.softRegInfo = res.data;
			}
		},
		goLogin()
		{
			this.$router.replace({
				path: '/'
			})
		}
	}
}
</script>
<style scoped>
.logo {
	text-align: center;
}

.welcome {
	padding-left: 15%;
}

.welcome .logo img {
	vertical-align: bottom;
	width: 100px;
	height: 100px;
	margin-bottom: 20px;
}

.welcome .logo h2 {
	font-size: 30px;
	font-weight: normal;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tips {
	margin-top: 20px;
	padding: 0 40px;
	width: 70%;
}

.tips-item {
	align-items: center;
	justify-content: center;
	padding: 7.5px 0;
}

.tips-item-icon {
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	font-size: 18px;
	margin-right: 20px;
	color: var(--el-color-primary);
	background: rgba(180, 180, 180, 0.1);
}

.tips-item-message {
	flex: 1;
	font-size: 16px;
	width: 200px;
	display: inline-flex;
	font-weight: 600
}

.tips-item-info {
	line-height: 28px;
	font-size: 14px
}

.actions {
	text-align: center;
	margin: 40px 0 20px 0;
}
</style>
